package com.wsc.wisdomchinaqinghe.activitity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.wsc.wisdomchinaqinghe.R;
import com.wsc.wisdomchinaqinghe.activitity.baseactivity.BaseActivity;


public class Login_RegisterActivity extends BaseActivity implements View.OnClickListener {
    private TextView tv_suibiankankan;
    private Button login, zhuce;
    private Context context;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.bootpagerstart_layout);
        context=this;
        initView();
    }

    private void initView() {
        tv_suibiankankan = (TextView) findViewById(R.id.tv_lookinto);
        login = (Button) findViewById(R.id.bt_login);
        zhuce = (Button) findViewById(R.id.bt_regist);
        tv_suibiankankan.setOnClickListener(this);
        zhuce.setOnClickListener(this);
        login.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent = null;
        switch (v.getId()) {
            case R.id.bt_login:
                intent = new Intent(context, LoginActivity.class);
                startActivityForResult(intent,0);
                break;
            case R.id.bt_regist:
                intent = new Intent(context, SMSActivity.class);
//                intent.putExtra("Source",Login_RegisterActivity.class.getSimpleName());
                startActivity(intent);
//                finish();
                break;
            case R.id.tv_lookinto:
                finish();
                break;
        }
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == 0) {
            if (resultCode == 1) {
//                Intent intent=new Intent(context,HomeActivity.class);
//                startActivity(intent);
                finish();
            }
        }
    }

}
